﻿<%@ Page Title="Loan Phones" Theme="POSSystem" Language="C#" MasterPageFile="~/EditPages/Popup.Master" AutoEventWireup="True" CodeBehind="LoanPhones.aspx.cs" Inherits="WebUI.EditPages.LoanPhones" %>

<%@ Register Src="~/Controls/POSControls/LoanPhoneListCtrl.ascx" TagName="LoanPhoneList" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PopupHeadHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PopupToolbarHolder" runat="server">
    <script type="text/javascript" >
        function onAddLoanPhone() {
            var id = getSelectedItemID<%=lstLoanPhone.ClientID %>();
            var returnValue = window.showModalDialog('<%=GetLoanPhoneEditPageLink() %>' + 'mode=new', '', 'dialogWidth=400px;dialogHeight=200px;resizable=no;help=no;unadorned=yes;');

            return returnValue > 0;
        }

        function onEditLoanPhone() {
            var id = getSelectedItemID<%=lstLoanPhone.ClientID %>();
            if(id == null){
                alert("No item was selected!");
                return false;
            }
            var returnValue = window.showModalDialog('<%=GetLoanPhoneEditPageLink() %>' + 'mode=edit&id=' + id, '', 'dialogWidth=400px;dialogHeight=200px;resizable=no;help=no;unadorned=yes;');
            return returnValue > 0;
        }

        function onRemoveLoanPhone() {
            var id = HasCheckedItems<%=lstLoanPhone.ClientID %>();
            if(id == false){
                alert("No item was selected!");
                return false;
            }
            return confirm("This action will delete all checked items. Do you want to continue?");
        }
    </script>
    <table class="popuptoolbar" width="100%">
        <tr>
            <td style="vertical-align:middle; text-align:left">
                <asp:LinkButton class="tbbutton" ID="btnAddLoanPhone" runat="server" OnClientClick="return onAddLoanPhone();"
                    OnClick="btnAddLoanPhone_OnClick">
                    <img src="~/Images/AddRecord.gif" runat="server" /><asp:Label ID="label5" runat="server" Text="Add"></asp:Label>
                </asp:LinkButton>
                <asp:LinkButton class="tbbutton" ID="btnEditLoanPhone" runat="server" OnClientClick=" return onEditLoanPhone();"
                    OnClick="btnAddLoanPhone_OnClick">
                    <img src="~/Images/Edit.gif" runat="server" /><asp:Label ID="label6" runat="server" Text="Edit"></asp:Label>
                </asp:LinkButton>
                <asp:LinkButton class="tbbutton" ID="btnDeleteLoanPhone" runat="server" OnClientClick="return onRemoveLoanPhone();"
                    OnClick="btnRemoveLoanPhone_OnClick">
                    <img src="~/Images/Delete.gif" runat="server" /><asp:Label ID="label7" runat="server" Text="Delete"></asp:Label>
                </asp:LinkButton>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PopupContentHolder" runat="server">
    <uc:LoanPhoneList ID="lstLoanPhone" Width="100%" runat="server" AllowPaging="true" AllowSelecting="true" ></uc:LoanPhoneList>
</asp:Content>
